{% extends "base.html" %}
{% import "_macros.html" as macros %}
{% import "_my_wtf_macros.html" as my_wtf_macros %}

{% block title %}万屏时代OPC--订单分布统计{% endblock %}

{% block panel_heading %}
    万屏时代OPC--订单分布统计
{% endblock %}

{% block panel_body %}
    <form id="search_form" action="{{ url_for('op_bp.demand_day_stat_list') }}" method="post" class="form" role="form">
        {{ my_wtf_macros.form_field(form.start_date, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.end_date, div_col=4, label_col=4, field_col=7) }}
        <div class="clearfix visible-xs-block visible-sm-block visible-md-block visible-lg-block"></div>
        <div class="pull-right btn-group">
            <button type="submit" class="btn btn-info">
                查询
            </button>
        </div>
    </form>

    {% if pagination %}
    <div class="pagination">
        {{ macros.pagination_widget(pagination, 'op_bp.demand_day_stat_list', **url_kwargs) }}
    </div>
    {% endif %}

    <table id="sms-log-table" class="table table-bordered table-hover table-condensed table-striped table-responsive">
        <thead>
            <tr>
                <th>日期</th>
                <th>发布数(首次)</th>
                <th>优先抢(首次)</th>
                <th>竞价(首次)</th>
                <th>回收</th>
                <th>发布数(二次)</th>
                <th>优先抢(二次)</th>
                <th>竞价(二次)</th>
            </tr>
        </thead>
    <tbody>
        {% for each in data %}
        <tr>
            <td>{{ each.stat_date }}</td>
            <td>{{ each.ro_first_cnt }}</td>
            <td>{{ each.bronze_first_cnt }}</td>
            <td>{{ each.ongoing_first_cnt }}</td>
            <td>{{ each.renewable_cnt }}</td>
            <td>{{ each.ro_second_cnt }}</td>
            <td>{{ each.bronze_second_cnt }}</td>
            <td>{{ each.ongoing_second_cnt }}</td>
        </tr>
        {% endfor %}
    </tbody>
    </table>

    {% if pagination %}
    <div class="pagination">
        {{ macros.pagination_widget(pagination, 'op_bp.demand_day_stat_list', **url_kwargs) }}
    </div>
    {% endif %}

{% endblock %}